<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Markdown Editor</title>
    <!-- 引入Editor.md的CSS文件 -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/editor.md/css/editormd.min.css" />
    <style>
        /* 设置编辑器的高度 */
        #editor {
            width: 100%;
            height: 500px;
        }
    </style>
</head>
<body>

    <!-- 创建Markdown编辑器的容器 -->
    <div id="editor">
        <textarea style="display:none;"> </textarea>
    </div>

    <!-- 引入jQuery -->
    <script src="https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js"></script>
    <!-- 引入Editor.md的JS文件 -->
    <script src="https://cdn.jsdelivr.net/npm/editor.md/editormd.min.js"></script>
    <!-- 初始化Editor.md编辑器 -->
    <script>
        $(function() {
            editormd("editor", {
                path : "https://cdn.jsdelivr.net/npm/editor.md/lib/", // Editor.md库路径
                width: "100%",
                height: 500,
                syncScrolling : "single",
                saveHTMLToTextarea : true // 保存HTML到Textarea
            });
        });
    </script>

</body>
</html>
